import Vue from 'vue'
import Router from 'vue-router'

import loadingPage from '@/pages/loading/loading'
import goodList from '@/pages/goodList/goodList'
import orderQuery from '@/pages/orderQuery/orderQuery'
import layout from '@/pages/layout/layout'
import goodDetail from '@/pages/goodDetail/goodDetail'

Vue.use(Router)

export default new Router({
  mode: "hash",
  routes: [
    {
      path: '/',
      name: 'loading',
      meta: {
        tile: '欢迎来到[珊瑚数卡]演示站点'
      },
      component: loadingPage,
    },
    {
      path:'/goodList',
      component:layout,
      children:[
        {
          path:'/goodList/:id',
          component:goodList,
          name:'goodList',
          meta:{
            title:'珊瑚数卡-产品列表'
          }
        }
      ]
    },
    {
      path:'/goodList',
      component:layout,
      children:[
        {
          path:'/goodList/:id/goodDetail',
          component:goodDetail,
          name:'goodDetail',
          meta:{
            title:'珊瑚数卡-产品详情'
          }
        }
      ]
    },
    {
      path:'/orderQuery',
      component:orderQuery,
      meta:{
        title:'珊瑚数卡-订单查询'
      }
    }
  ]
})
